/**
 * 用户登录 api
 * Created by lifetime on 2018/1/23.
 */
import { Injectable } from '@angular/core';
import { HttpParams } from '@angular/common/http';

import { HttpUtil } from '../HttpUtil';

@Injectable()
export class LoginApi{

  constructor (public httpUtil: HttpUtil){
  }

  /**
   *
   * @param num
   * @param pwd
   * @returns {boolean}
   */
  auth(num:string,pwd:string){
    const params = new HttpParams().set("number",num).set("pwd",pwd);
    return this.httpUtil.get("/api/login/auth",params);
  }

  out(num:string){
    const params = new HttpParams().set("number",num).set("token",localStorage.getItem("token"));
    return this.httpUtil.get("/api/login/out",params);
  }

}
